<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!-- /************ Table ************/
.xwtable {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #ccc;
}

.xwtable thead td {
	font-size: 12px;
	color: #333333;
	text-align: center;
	/*background: url(table_top.jpg) repeat-x top center;*/
	border: 1px solid #ccc;
	font-weight: bold;
}

.xwtable tbody tr {
	background: #fff;
	font-size: 12px;
	color: #666666;
}

.xwtable tbody tr.alt-row {
	background: #f2f7fc;
}

.xwtable td {
	line-height: 20px;
	text-align: left;
	padding: 4px 10px 3px 10px;
	height: 18px;
	border: 1px solid #ccc;
}
-->
</style>
<link rel="stylesheet" href="../static/css/bootstrap.min.css"></link>
</head>

<body>
	<div class="container" style="margin-bottom: 2px;margin-top: 75px;">
		<div class="row">
			<div class="col-md-6">
				<div class="input-group">
					<input type="text" class="form-control" placeholder="请输入检索关键字(目前只支持企业名称模糊查询)"></input>
					<span class="input-group-btn">
						<button class="btn btn-primary">检索</button> </span>
				</div>
			</div>
		</div>
	</div>
	<div style="margin-top: 85px;">
		<table class="table table-striped">
			<thead>
				<tr>
					<td>企业名称</td>
					<td>手机号</td>
					<td>地址</td>
					<td>邮件</td>
					<td>经营状态</td>
					<td>成立日期</td>
					<td>法定代表人</td>
					<td>人员规模</td>
					<td>人数</td>
					<td>简介</td>
				</tr>
			</thead>
			<tbody id="tbody-result">
			</tbody>
		</table>
	</div>
	<script type="text/javascript" src="../static/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../static/js/jquery.js"></script>
	<script type="text/javascript">
       $.ajax({
		// 几个参数需要注意一下
		type : "get",// 方法类型
		dataType : "json",// 预期服务器返回的数据类型
		url : "../enterprise/selectAll",// url
		data : $('#form1').serialize(),
		success : function(result) {
			console.log(result.data.list[0].name);// 打印服务端返回的数据(调试用)
			if (result.status==0 ) {
				 var str = "";                
				      var data = result.data.list;         
				               for (i in data) {           
				               str += "<tr>" +                  
				        "<td>" + data[i].name + "</td>" +        
				                      "<td>" + data[i].phone + "</td>" +      
				                    "<td>" + data[i].address + "</td>" +      
				                    "<td>" + data[i].email + "</td>" +     
				                     "<td>" + data[i].operatingState + "</td>" +        
				                  "<td>" + data[i].checkdate + "</td>" +            
				              "<td>" + data[i].legalRepresentative + "</td>" +              
				            "<td>" + data[i].personnelScale + "</td>" +               
				           "<td>" + data[i].number + "</td>" +    
				           "<td>" + data[i].briefIntroduction + "</td>" +                 
				         "</tr>";                   
				   }  
				console.log(str);// 打印服务端返回的数据(调试用)                 
				   $("#tbody-result").html(str);  


			}
			;
		},
		error : function() {
			alert("异常！");
		}
	});

    </script>
</body>
</html>
